# -*- mode: snippet -*-
# name : lkm_make
# --
ifneq ($(KERNELRELEASE),)

obj-m := $1.o

else

KERNELDIR = /lib/modules/$(shell uname -r)/build
PWD = $(shell pwd)

.PHONY : default clean start stop

default :
	make -C $(KERNELDIR) M=$(PWD) modules

clean :
	rm -rf *.o *.ko *.mod.* *.order *.symvers .*.cmd .tmp_versions

start:
	insmod ./$1.ko

stop:
	rmmod $1

endif
